//
//  ZMNavTopView.m
//  DaMei
//
//  Created by mac on 16/2/22.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "ZMNavTopView.h"


@interface ZMNavTopView()
@property (weak, nonatomic) IBOutlet UIButton *button;
@property (weak, nonatomic) IBOutlet UILabel *titel;
@property (weak, nonatomic) IBOutlet UILabel *subTitel;

@end

@implementation ZMNavTopView

+(instancetype)navTopView {

    return [[[NSBundle mainBundle] loadNibNamed:@"ZMNavTopView" owner:nil options:nil] lastObject];
}

-(void)awakeFromNib {

    self.autoresizingMask = UIViewAutoresizingNone;
    
    
}
-(void)addTarget:(id)target action:(SEL)action {

    [self.button addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
}

///设置主标题
- (void)setTitle:(NSString *)title {

    self.titel.text = title;
}

///设置子标题
- (void)setSubTitle:(NSString *)subTile {
    
    self.subTitel.text = subTile;
    
}

/// 设置图片
- (void)setIconWithName:(NSString *)iconName withHighlightIconName:(NSString *)highlighttIconImage {
    
    [self.button setImage:[UIImage imageNamed:iconName] forState:UIControlStateNormal];
    [self.button setImage:[UIImage imageNamed:highlighttIconImage] forState:UIControlStateHighlighted];
}

@end
